package com.luge.model.request;

import android.os.Handler;
import android.os.Message;

public class RequestThread extends Thread {
	private Task mTask;
	private Handler mHandler;

	public static RequestThread newInstance(Task mTask, Handler mHandler) {
		RequestThread mThread = new RequestThread();
		mThread.mTask = mTask;
		mThread.mHandler = mHandler;
		return mThread;
	}

	@Override
	public void run() {
		super.run();
		Message msg = new Message();
		msg.what = mTask.getId();
		msg.obj = ParseJSON.request(mTask);
		mHandler.sendMessage(msg);
	}

}
